// --------------------------------------------------------------------------------------------------------------------
// <copyright file="InstrumentStaticDataEquityIndexFuture.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Org.OpenTrader.Framework.Forge
{
    #region Using Directives

    using System;
    using System.ComponentModel;

    using Org.OpenTrader.Framework.Entities;
    using Org.OpenTrader.Framework.Forge.Attributes;
    using Org.OpenTrader.Framework.Forge.Enums;
    using Org.OpenTrader.Framework.Forge.Interfaces;

    #endregion

    /// <summary>
    /// The instrument forex future.
    /// </summary>
    [Serializable]
    [InstrumentFriendlyDisplay("Equity Index Future", "Future instrument written on Equity Index")]
    public sealed class InstrumentStaticDataEquityIndexFuture : InstrumentStaticData, IInstrumentStaticDataEquityIndexFuture
    {
        #region Constructors and Destructors

        public InstrumentStaticDataEquityIndexFuture(Guid dictionaryID, DBInstrumentStaticDataEquityIndexFuture dbInstrumentEquityIndexFuture, DBInstrumentStaticData dbInstrument)
            : base(dictionaryID, dbInstrument)
        {
            if (dbInstrumentEquityIndexFuture.Maturity.HasValue)
            {
                this.Maturity = dbInstrumentEquityIndexFuture.Maturity.Value;
            }
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets Maturity.
        /// </summary>
        [Category("Equity Index Future")]
        [Description("Maturity date")]
        public DateTime Maturity { get; set; }

        /// <summary>
        /// Gets Type.
        /// </summary>
        public override string Type
        {
            get
            {
                return "EquityIndexFuture";
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// The string representation.
        /// </summary>
        /// <returns>
        /// Returns "Forex Future"
        /// </returns>
        public override string ToString()
        {
            return base.ToString() + " (Forex Future)";
        }

        #endregion
    }
}